package DAO;

import org.hibernate.Session;


import to.Endereco;
import util.HibernateUtil;

public class EnderecoDAO {
	
	public Endereco buscarSalvar(Endereco enderecoPesquisar) throws Exception {
		Endereco endereco = null;
		try {
			Session session = HibernateUtil.getSessionFactory().openSession();
			endereco = (Endereco) session.get(Endereco.class, enderecoPesquisar);
		} catch (Exception e) {
			throw new Exception(e.getMessage());
		}		
		return endereco;
	}
	
}
